﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Inventory
{
    /// <summary>
    /// Interaction logic for ProductList.xaml
    /// </summary>
    public partial class ProductList : Window
    {
        private CollectionViewSource _containsProductListViewSource;
        public int ProductID;

        public ProductList(IQueryable productList)
        {
            InitializeComponent();

            _containsProductListViewSource = (CollectionViewSource)FindResource("ContainsProductListViewSource");
            _containsProductListViewSource.Source = productList;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            ProductID = (int)gridProductList.SelectedValue;
            this.DialogResult = true;
            this.Close();
        }
    }
}
